package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.mapper.CustomerAttributeMapper;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.CustomerAttributeEntity;
import com.ly.heart.service.ICustomerAttributeService;

import javax.annotation.Resource;

/**
 * 客户属性Service业务层处理
 * 
 * @author cxl
 * @date 2024-05-14
 */
@Service
public class CustomerAttributeServiceImpl extends ServiceImpl<CustomerAttributeMapper,CustomerAttributeEntity> implements ICustomerAttributeService
{
    @Resource
    private CustomerAttributeMapper customerAttributeEntityMapper;

    /**
     * 查询客户属性
     * 
     * @param id 客户属性主键
     * @return 客户属性
     */
    @Override
    public CustomerAttributeEntity selectCustomerAttributeEntityById(String id)
    {
        return customerAttributeEntityMapper.selectCustomerAttributeEntityById(id);
    }

    /**
     * 查询客户属性列表
     * 
     * @param customerAttributeEntity 客户属性
     * @return 客户属性
     */
    @Override
    public List<CustomerAttributeEntity> selectCustomerAttributeEntityList(CustomerAttributeEntity customerAttributeEntity)
    {
        return customerAttributeEntityMapper.selectCustomerAttributeEntityList(customerAttributeEntity);
    }

    /**
     * 新增客户属性
     * 
     * @param customerAttributeEntity 客户属性
     * @return 结果
     */
    @Override
    public int insertCustomerAttributeEntity(CustomerAttributeEntity customerAttributeEntity)
    {
        customerAttributeEntity.setId(SnowflakeIdWorker.getInstance().nextStringId());
        return customerAttributeEntityMapper.insertCustomerAttributeEntity(customerAttributeEntity);
    }

    /**
     * 修改客户属性
     * 
     * @param customerAttributeEntity 客户属性
     * @return 结果
     */
    @Override
    public int updateCustomerAttributeEntity(CustomerAttributeEntity customerAttributeEntity)
    {
        return customerAttributeEntityMapper.updateCustomerAttributeEntity(customerAttributeEntity);
    }

    /**
     * 批量删除客户属性
     * 
     * @param ids 需要删除的客户属性主键
     * @return 结果
     */
    @Override
    public int deleteCustomerAttributeEntityByIds(String[] ids)
    {
        return customerAttributeEntityMapper.deleteCustomerAttributeEntityByIds(ids);
    }

    /**
     * 删除客户属性信息
     * 
     * @param id 客户属性主键
     * @return 结果
     */
    @Override
    public int deleteCustomerAttributeEntityById(String id)
    {
        return customerAttributeEntityMapper.deleteCustomerAttributeEntityById(id);
    }
}
